﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using API.Interfaces;
using Framework.Business;
using Framework.Extensions;
using RealDataReceiver.Business;
using RealDataReceiver.Entities;

namespace RealDataReceiver.Service
{
    public class AlarmHanleService : RestServiceBase<AlarmHanleRequest>
    {
        public override object OnDelete(AlarmHanleRequest request)
        {
            var response = new AlarmHanleResponse();

            try
            {
                var ctx = new ServiceContextBase<AlarmHanleRequest, AlarmHanleResponse>(request, response);

                AlarmReceiveBusiness.DeleteAlarm(ctx);

                ctx.Response.Succeeded = true;
            }
            catch (Exception e)
            {
                response.CaptureException(e);
            }
            return response;
        }
    }
}
